import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import dts from 'vite-plugin-dts'
import { resolve } from "path"

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(), dts({ tsconfigPath: "tsconfig.app.json", outDir: "dist/types" })],
  build: {
    sourcemap: false,
    copyPublicDir: false,
    outDir: "./dist",
    lib: {
      entry: resolve(__dirname, "lib/index.ts"),
      formats: ['es']
    },
    rollupOptions: {
      external: ['vue'],
      output: {
        globals: {
          vue: 'Vue'
        }
      }
    }
  }
})
